package com.hnevc.androidui6;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends AppCompatActivity {
    Button mBtnLogin;
private EditText et_password;
    private EditText et_name;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        et_name = (EditText) findViewById(R.id.et_username);
        et_password = (EditText) findViewById(R.id.et_password);
        mBtnLogin = findViewById(R.id.btn_register);
        mBtnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //定义显示意图
                Intent intent = new Intent(LoginActivity.this,ActivityExample.class);
                //添加
                intent.putExtra("name",et_name.getText().toString().trim());
                intent.putExtra("password",et_password.getText().toString().trim());
                startActivity(intent);
            }
        });
    }
}
